<?php

	$TEMP->set_file(array('handle' => DIR_VIEW_REGISTRAR . 'semesterSY.html'));
	
	$getSemesterSY = $DSC->getSemesterSY();

	# LSITING
	if ( !empty($getSemesterSY) ) {
		
		$TEMP->set_block('handle',  'semesterSY', 'semesterSYRow');
		$bgcolor 	= LOOPING_F0F;
		$numCount 	= 1;
			
		foreach($getSemesterSY as $semesterSYValue) {
			
			if ($semesterSYValue['is_summer'] == 'Y') {
				$sy_year = 'Summer :: SY ' . $semesterSYValue['year_to'];
			}
			elseif ( $semesterSYValue['year_from'] == $semesterSYValue['year_to'] )  {
				$sy_year = '1st Semester :: SY ' . $semesterSYValue['year_to'];
			}
			else {
				$sy_year = '2nd Semester :: SY ' . $semesterSYValue['year_from'] . '-' . $semesterSYValue['year_to'];
			}
			
			$edButton = ( $semesterSYValue['year_idPK'] == $activeYear ) ? '&nbsp;<img src="' . DIR_IMAGES . 'icon/check.png" border="0"/>' : '';
			
			$TEMP->set_var(array('year_id'		=> $semesterSYValue['year_idPK'],
								 'sy_year'		=> $sy_year,
								 'numbering'	=> $numCount . '.',
								 'bgcolor'		=> $bgcolor,
								 'ed_button'	=> $edButton
								));
								
			$TEMP->parse('semesterSYRow', 'semesterSY', true);
			$bgcolor = ($bgcolor == LOOPING_F0F) ? LOOPING_FFF : LOOPING_F0F;
			$numCount++;
		}
	}
	else {
		$TEMP->set_var(array('stud_id' 		=> '',
							 'stud_no' 		=> '---------',
							 'name' 		=> '---------',
							 'course_code'	=> '----------',
							 'semester' 	=> '--------------',
							 'if_enroll'	=> '',
							 'is_deleted' 	=> '',
							 'numbering'	=> '#',
							 'bgcolor'		=> '',
							 'ed_button'	=> '',
							));
	}
	
	$TEMP->set_var(array('search' 			=> $search,
						 'pagination'		=> $pagination,
						 'results'			=> "<strong>" . $listCountStudentInformation . "</strong> results",
						 'urlPage'			=> $urlPage,
						 'reg_sub_menu'		=> $pageLib->registrarSubMenu(DIR_IMAGES),
						));
?>